import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_audit_app/res/strings.dart';

import 'colors.dart';
import 'dimens.dart';

/// 间隔
class Gaps {
  /// 水平间隔
  static const Widget hGap4 = SizedBox(width: Dimens.gap_dp4);
  static const Widget hGap5 = SizedBox(width: Dimens.gap_dp5);
  static const Widget hGap8 = SizedBox(width: Dimens.gap_dp8);
  static const Widget hGap10 = SizedBox(width: Dimens.gap_dp10);
  static const Widget hGap12 = SizedBox(width: Dimens.gap_dp12);
  static const Widget hGap15 = SizedBox(width: Dimens.gap_dp15);
  static const Widget hGap16 = SizedBox(width: Dimens.gap_dp16);
  static const Widget hGap32 = SizedBox(width: Dimens.gap_dp32);

  /// 垂直间隔
  static const Widget vGap4 = SizedBox(height: Dimens.gap_dp4);
  static const Widget vGap5 = SizedBox(height: Dimens.gap_dp5);
  static const Widget vGap8 = SizedBox(height: Dimens.gap_dp8);
  static const Widget vGap10 = SizedBox(height: Dimens.gap_dp10);
  static const Widget vGap12 = SizedBox(height: Dimens.gap_dp12);
  static const Widget vGap15 = SizedBox(height: Dimens.gap_dp15);
  static const Widget vGap16 = SizedBox(height: Dimens.gap_dp16);
  static const Widget vGap24 = SizedBox(height: Dimens.gap_dp24);
  static const Widget vGap32 = SizedBox(height: Dimens.gap_dp32);
  static const Widget vGap50 = SizedBox(height: Dimens.gap_dp50);

  static Widget hLine = Container(
    constraints: BoxConstraints(maxWidth: 0.7),
    color: Colours.u_b1c8e1,
  );

  static Widget dividerH({int hex = 0xffBECEC2}) {
    return Container(
      height: 0.5,
      color: Color(hex),
    );
  }

/*  static Widget headerDivider = Container(
    width: 1000,
    height: 0.7,
    color: Colours.u_b1c8e1,
  );*/

/*  static Widget horizonLine = DecoratedBox(
    decoration: BoxDecoration(
      border: Border.all(color: Colors.grey[200], width: 1.0),
    ),
  );*/

/*  static const Widget line = Divider(
    color: Colors.green,
    height: 28,
    thickness: 1,
    indent: 1,
    endIndent: 1,
  );

  static const Widget vLine = SizedBox(
    width: 0.6,
    height: 24.0,
    child: VerticalDivider(),
  );*/

  static const Widget empty = SizedBox.shrink();

  static const Widget operateBtn = Text(
    Strings.operateTxt,
    style: TextStyle(
      fontSize: 12,
      color: Colors.blue,
    ),
  );

  static Widget noDataPlaceholder = Container(
    constraints: BoxConstraints(),
    child: Column(
      mainAxisAlignment: MainAxisAlignment.center,
      crossAxisAlignment: CrossAxisAlignment.center,
      children: <Widget>[
        Expanded(
          child: SizedBox(),
          flex: 3,
        ),
        SizedBox(
          width: 100.0,
          height: 100.0,
          child: Image.asset('assets/images/no_data.png'),
        ),
        Text(
          Strings.noDataTxt,
          style: TextStyle(fontSize: 16.0, color: Colors.grey[400]),
        ),
        Expanded(
          child: SizedBox(),
          flex: 2,
        ),
      ],
    ),
  );
}
